VERSION=1.0
BOPPROCESSDIR = bopprocess$(VERSION)

all : bopprocess

package :
	mkdir -p $(BOPPROCESSDIR)
	cp -t $(BOPPROCESSDIR) bopprocesstools.ml bopprocess.ml README check.bop bddchecker.bpo
	cp bopprocessMakefile $(BOPPROCESSDIR)/Makefile
	tar -czf bopprocess$(VERSION).tar.gz $(BOPPROCESSDIR)

install :
	cp -t $(BEBOPDIR)/bin bopprocess

bopprocess : listMap.cmx bopprocesstools.cmx parserSSA.cmx lexerSSA.cmx bopprocess.ml
	ocamlopt -o bopprocess unix.cmxa graphics.cmxa -I $(BEBOPDIR)/boplibs bplib.cmxa $^

cmo : listMap.cmo bopprocesstools.cmo parserSSA.cmo lexerSSA.cmo 

%.cmx : %.ml
	ocamlopt -c $<

%.cmo : %.ml
	ocamlc -c $<

bopprocesstools.cmo : bopprocesstools.ml
	ocamlc -I +bebop -c $<

bopprocesstools.cmx : listMap.cmx bopprocesstools.ml
	ocamlopt -c unix.cmxa graphics.cmxa -I $(BEBOPDIR)/boplibs bplib.cmxa bopprocesstools.ml

parserSSA.ml : bopprocesstools.cmx parserSSA.mly
	ocamlyacc parserSSA.mly
	ocamlc -c parserSSA.mli

lexerSSA.ml : lexerSSA.mll 
	ocamllex lexerSSA.mll

clean :
	rm -f *.cmi *.cmx *.o
	rm -f parserSSA.ml lexerSSA.ml

clean_exe :
	rm -f bopprocess
